Hello, and welcome to this expert viewpoints video. Let's hear from experts as they talk about prompt engineering and the role it plays in generative AI. Prompt engineering basically is the technique of writing good or effective prompts, which the model will be able to use to create effective outputs that is consistent and prominent outputs. The techniques that are usually in place for prompt engineering are with respect to the application that you use, but the basic things are there. You have to have the clarity of thought, the context, and list out the particular features that you want from it. Prompt engineering is a term that's come around in the last couple of years because of generative AI. And so what prompt engineering is, is understanding how to prompt the large language model to get the responses you want. So there are things like zero-shot prompting, where it's a typically the way people use Chat GPT today, where they just ask it to do something. So the shot is an example. So zero-shot, no example is just do this. And then there's one-shot where you go, Hey, can you write this out for me? Here's an example of the format that I want you to use. So now it can use the format to inform the information that it needs and ask you questions and format the output a little bit better. For prompt engineering, there is many different parameters that we can use to interact with the model. So first we should specify the task and explicitly ask the model what we are looking for and provide you some context. And sometimes we can provide you some examples, which is the concept of a few-shot learning so that the model can learn or see how we want the output to be. We can have some iterative feedback so that the model can learn based on the different prompts and fine tuning. We can see which one is performing better and provides us with the response that we are looking for. There are things like few-shot, remember shots are examples. So few shot means you give it two or three more examples. And the interesting thing with the examples is they don't have to be correct examples. They just need to be formatted correctly. So what you can do is you can do a couple of examples and then can actually use GenAI to create more examples for you in that same format and then you can add that to your prompt. Prompt generation is just so critically important to get the right outputs from your prompts. It's as simple as if you ask the wrong question, you're going to get the wrong answer back. So that applies to humans too. And at this point in time, it's especially true for these generative AI models. And then there are things like chain of thought where you say, I'm going to give you a series of steps and I want you to fill the plan and then think step by step as you execute this. When you do that in a prompt, it helps the LLM stay on track. So it'll make a plan, it'll hold that internally, and then it'll go through each of those instructions one by one and then put the answer together at the end. So if you have a very complex thing that you're trying to do, try doing things like chain of thought in your prompting. And again, the biggest thing and the thing that you hear the most is tell it to play a role or give it a specific type of person to be, like as a JavaScript expert, as a product manager, as the CEO of a small business organization. The more you can give it those types of examples, the better that your output is going to be. Moving on, let's explore what experts have to say about their experiences using Common Prompt Engineering tools. One of the most prominent tools that are available for prompt engineering is the watsonx Studio Prompt Engineering Lab, which particularly is a very good tool for practicing and developing effective prompts for a specific application. What are some common prompt engineering tools? The sites like OpenAI, I'm sure Microsoft Copilot, they have sections on how to write good prompts. And if you can use these tools to help you write your prompt and see if you're going to get the kind of responses you get. Other thing is that how generative and restricted we want to make our model. So there are some parameters like temperature, top-k, top-p, that enables our model to be more generative as well. So we can control that and we can provide some examples, as I mentioned, so that the model knows what is the desired structure of the output that you are looking for. So prompt engineering is actually a task that enables us to interact with our model and ask it to provide a response in a format and in a way that we are looking for. For example, I was working with ChatGPT and I wanted to understand how to explain a workflow to it. And I have a background, so I have different formats that I could have used. So I basically said, Hey, I want you to analyze the workflow for me. What's the best format for me to give that to you in? And it came back and it gave me a structure. It said, Hey, if you can put it in a structure, it'll help me correlate these fields when you ask me questions. As part of my prompt, I prompted it and I created the structure that I wanted. And sure enough, it could match one-to-one and do all kinds of interesting things that I wanted it to do. Models like Llama2 have actually specific syntaxes that you have to follow. And if you don't follow those correctly, you're going to have a bad time. Now, things still work. You still get output. And in all cases, you'll still get an output. But the point is, we want to get the output we want with as little trial and error and as little waste of time and money and resources as possible. So prompt engineering, super valuable right now. Very easy to learn. Definitely is something which I would invest a good amount of time in right up front.